<template>
  <div>
    <div class="home-box box-3-list">
      <div class="center-box1">
        <div class="box-title-1">
          <img src="@/assets/image/5.webp" alt="">
          <div class="center">
            <p>我报名的活动</p>
            <p>我的活动，这里可以创建活动～</p>
          </div>
        </div>
        <div v-if="tableData.length>0" class="box-2-nav">
          <div class="box-item-length" v-for="(item,index) in tableData" :key="index">
            <img
                class="img-left"
                :src="item.cover"
                alt="">
            <div class="right-box">
              <p class="titles over-hide-1">
                {{ item.title }}
              </p>
              <p class="time">报名时间：{{ parseTime(item.beginTime) || '暂无数据' }}</p>
              <p class="time">报名时间：{{ parseTime(item.endTime) || '暂无数据'  }}</p>
              <p class="time"> 活动地址：{{ item.address }}</p>

              <a class="btn-bot"  href="javascript:void (0)">
                已有{{item.applicationCount}}人参与
              </a>
            </div>
          </div>
        </div>
        <el-empty v-else></el-empty>
      </div>
    </div>



    <lz-footer></lz-footer>

    <el-dialog :visible.sync="dialogVisible" width="850px" :before-close="handleClose">
      <div class="dialogs">
        <div class="dialog-left">
          <img src="@/assets/image/logo.webp" alt="">
        </div>
        <div class="dilog-right">
          <div class="title">
            什么样的女人让男人疯狂？答案并不是姿色
          </div>
          <div class="time">
            发表于：2023-12-31
          </div>
          <div class="content">

            男人好色是共识。大部分人都认为男人是下半身动物，只要女人漂亮、性感就能吸引男人。这有合理的成分，但绝不是事实的全部。
            <br>
            真相是，一个女人的美色可以吸引男人，诱惑男人，但绝不可能长久地留住他们的心。美人有迟暮的时候，美色有厌倦的时候，女人要留住男人的心，还需要更重要的东西。

          </div>
        </div>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import LzSubmit from "@/components/lz-submit.vue";
import {getAllUser, getMyEventApplicationList} from "@/api/apiFox";
import {parseTime} from "../../utils";

export default {
  components: {LzSubmit},
  data() {
    return {
      imageUrl:"",
      dialogVisible:false,
      total:100,
      queryParams:{
        pageNum:1,
        pageSize:10
      },
      tableData: [],
      form: {}
    }
  },
  methods:{
    parseTime,
    handleClose(){
      this.dialogVisible=false
    },

    getList(queryParams){
      getMyEventApplicationList(queryParams).then(res=>{
        this.tableData = res.list
        this.queryParams.pageNum = res.pageNum
        this.queryParams.pageSize = res.pageSize
        this.total = res.totalCount
      }).catch(err=>{})
    },
  },
  mounted() {
    this.getList(this.queryParams)
  }
}
</script>

<style scoped lang="scss">
>>>.el-table th.el-table__cell {

  background-color: transparent;
  background: none;
}
.dialogs{
  width: 100%;
  min-height: 400px;
  position: relative;
  display: flex;
  justify-content: space-between;
  .dialog-left{
    width: 400px;
    min-height: 400px;
    img{
      width: 400px;
      height: 600px;
      object-fit: cover;
    }
  }
  .dilog-right{
    width: 450px;
    border-left: 1px solid #f6f6f6;
    padding-left: 20px;
    box-sizing: border-box;
    .title{
      font-size: 18px;
      margin-top: 30px;
      color: #000;
    }
    .time{
      font-size: 12px;
      color: #999;
      margin-top: 10px;
    }
    .content{
      width: 100%;
      min-height: 50px;
      overflow-y: scroll;
      max-height: 600px;
      margin-top: 10px;
    }
    .content::-webkit-scrollbar{
      display: none;
    }
    .comment{
      width: 100%;
      //background: red;
      border-top: 1px solid #f2f2f2;
      margin-top: 20px;
      padding-top: 10px;
      height: 250px;
      overflow-y: scroll;
      .item-nav-comment{
        width: 100%;
        .item-comment{
          width: 100%;
          display: flex;
          margin-bottom: 10px;
          .avatar{
            height: 30px;
            border-radius: 50%;
            width: 30px;
            object-fit: contain;
          }
          .right-box{
            margin-left: 10px;
            p:nth-child(1){
              font-size: 14px;
              color: rgba(168,168,168);
            }
            p:nth-child(2){
              min-height: 30px;
              font-size: 14px;
              color:#000;
            }
          }
        }
        .children{
          width: 100%;
          padding-left: 30px;
          box-sizing: border-box;
          .item-comment{
            width: 100%;
            display: flex;
            margin-bottom: 10px;
            .avatar{
              height: 30px;
              border-radius: 50%;
              width: 30px;
              object-fit: contain;
            }
            .right-box{
              margin-left: 10px;
              p:nth-child(1){
                font-size: 14px;
                color: rgba(168,168,168);
              }
              p:nth-child(2){
                min-height: 30px;
                font-size: 14px;
                color:#000;
              }
            }
          }
        }
      }


    }
    .comment::-webkit-scrollbar{
      display: none;
    }
    .input{
      width: 430px;
      height: 60px;
      //position: absolute;
      bottom: 0;
      //background: red;
      border-top: 1px solid #f6f6f6;
      padding-top: 15px;
      display: flex;
      align-items: center;
      input{
        height: 40px;
        width: 280px;
        background: rgba(248,248,248);
        border-radius: 30px;
        text-indent: 20px;
      }
      input::placeholder{
        color: #999;
      }
      .btn{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100px;
        height: 40px;
        margin-left: 10px;
        border-radius: 40px;
        background: #fc476d;
        color: #fff;
      }
    }
  }
}
.home-box {
  width: 100%;
  min-height: calc(100vh - 140px);
  background: var(--homeBgk);
  display: flex;
  justify-content: center;

  .home-center {
    width: 1200px;
    min-height: calc(100vh - 140px);
    display: flex;
    justify-content: space-between;
    //background: #fff;
    .left {
      width: 600px;
      padding-top: 20vh;
      box-sizing: border-box;

      .logo {
        margin: 10px 0;
      }

      .title {
        font-size: 36px;
        font-weight: 400;
        //text-align: center;
        color: var(--textColor);
      }

      .content {
        font-size: 14px;
        margin-top: 15px;
        color: var(--colorTip);
      }

      .btn {
        width: 100%;
        margin-top: 30px;

        a {
          display: flex;
          align-items: center;
          justify-content: center;
          width: 150px;
          font-size: 14px;
          height: 45px;
          color: #fff;
          background: #333;
          border-radius: 10px;
        }
      }
    }

    .right {
      width: 800px;
      margin-right: -200px;
    }
  }
}

.box-nav-list {
  background: var(--navBgk);
  height: 200px !important;
  margin-bottom: -200px;

  .home0-center {
    width: 1200px;
    padding-top: 120px;
    display: flex;
    height: 200px;
    justify-content: space-between;

    .item {
      width: 300px;
      height: 300px;
      text-align: center;

      .nav-box {
        width: 100%;
        height: 120px;
        border-radius: 50%;

        img {
          width: 100px;
          height: 100px;
          object-fit: cover;
        }
      }

      .title {
        font-size: 22px;
        color: var(--textColor);
        font-weight: 600;
      }

      .box-center {
        margin-top: 15px;
        font-size: 12px;
        color: var(--colorTip);
      }
    }
  }
}

.box-3-list {
  width: 100%;
  background: var(--navBgk);
  padding-bottom: 150px;
  padding-top: 45px;

  .center-box1 {
    width: 1200px;

    .box-title-1 {
      width: 100%;
      text-align: center;
      position: relative;

      .center {
        width: 100%;
        position: absolute;
        margin-top: -30px;

        p:nth-child(1) {
          font-size: 28px;
          font-weight: 600;
          color: #fc476d;
        }

        p:nth-child(2) {
          font-size: 12px;
          color: var(--colorTip);
        }
      }
    }

    .box-2-nav {
      width: 100%;
      margin-top: 100px;
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;

      .box-item {
        margin-bottom: 25px;
        width: 278px;
        min-height: 480px;
        background: var(--itemBgk);
        //border-radius: 10px;
        overflow: hidden;
        padding: 10px;
        box-sizing: border-box;
        box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;

        .image {
          width: 100%;
          height: 250px;
          object-fit: cover;
        }

        .nav {
          width: 100%;
          margin-top: 15px;
          display: flex;
          justify-content: space-between;

          .left-icon {
            font-size: 14px;
            color: var(--navCircle);

            i {
              color: #fc476d;
            }
          }
        }

        .nav-content {
          font-size: 14px;
          margin-top: 10px;
          color: var(--colorTip);
        }

        .btn {
          width: 100%;
          height: 40px;
          display: flex;
          justify-content: center;
          margin-top: 18px;
          align-items: center;
          border: 1px solid var(--switchBorder);
          color: var(--activeColor);
        }
      }

      .box-item-length {
        width: 48%;
        margin: 10px 0;
        min-height: 150px;
        padding: 10px;
        background: var(--itemBgk);
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;

        .img-left {
          width: 220px;
          height: 220px;
          object-fit: cover;
        }

        .right-box {
          width: calc(100% - 220px);
          margin-left: 15px;
          padding-top: 15px;
          box-sizing: border-box;

          .titles {
            font-weight: 600;
            font-size: 18px;
            color: var(--navCircle);
          }

          .time {
            font-size: 16px;
            color: var(--navCircle);
            margin-top: 10px;
          }

          .btn-bot {
            margin-top: 20px;
            width: 200px;
            height: 42px;
            border-radius: 5px;
            background: #42b983;
            color: var(--navBgk);
            font-size: 14px;
            display: flex;
            justify-content: center;
            align-items: center;
          }
        }
      }
    }
    .table{
      margin-top: 120px;
      margin-bottom: 20px;
    }
    .box-bottom {
      width: 100%;
      display: flex;
      //justify-content: center;
      margin-top: 30px;
    }
  }
}

::v-deep(.el-dialog){
  border-radius: 30px;
}
.avatar-uploader{
  width: 150px;
  height: 150px;
  //border-radius: 50%;
  display: flex;
  align-items: center;
  border: 1px dashed #d9d9d9;
}

.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 150px;
  height: 150px;
  line-height: 150px;
  text-align: center;
}
.avatars {
  width: 150px;
  height: 150px;
  display: block;
}
</style>
